package paperfly.game;

import java.util.concurrent.Callable;

import paperfly.game.state.MainMenuState;

import com.jme.util.GameTaskQueueManager;
import com.jmex.game.StandardGame;
import com.jmex.game.state.DebugGameState;
import com.jmex.game.state.GameStateManager;

public class PaperFlyGame {
	private static StandardGame game = null;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		game = new StandardGame("PaperFly");
		game.setDialogBehaviour(1,"images/loading/2.jpg");
		game.start();
		
		GameStateManager.create();		
		GameTaskQueueManager.getManager().update(new Callable<Object>() {
			public Object call() throws Exception {
				MainMenuState menu = new MainMenuState("menu");
				GameStateManager.getInstance().attachChild(menu);
				menu.setActive(true);
				return null;
			}
        });
		DebugGameState debug = new DebugGameState();
		GameStateManager.getInstance().attachChild(debug);
		debug.setActive(true);
		
	}
	public static void recriar(){
		game.getSettings().setWidth(800);
		game.getSettings().setHeight(600);
		game.getSettings().setFullscreen(true);
		game.recreateGraphicalContext();
	}
	public static void sair() {
		GameStateManager.getInstance().setActive(false);
		game.finish();
	}

}
